import urllib,urllib2,re,os,xbmc

#author:
#elypter
#-mail:elypter@yahoo.de
#
#inspired by jdownloader-megavideo-hoster-plugin and the megavideo-player-actionscript-sourcecode
#
#for details look at default.py

#megavideo.com hoster plugin
def check(url):
	if url.rfind("zshare.net"):
		return 1
	else:
		return 0

def get_regexp():
	#return "(?:http\://www\.megavideo\.com/v/([A-Z]+)[0-9a-z]*|http\://www\.megavideo\.com/\?v\=([0-9a-z]*))"
	print "checking zshare"
	return "http\://www\.zshare\.net/(?:\?v\=|v/)([0-9a-zA-Z]{8})"
def get_name():
	return "zshare"
def join(id):
	return "http://www.zshare.net/video/"+id
	
def get_link1(url):
	#takes an videopage-url of megavideo
	#
	#returnes the service/mirror name, the url that will be passed over to get_link2, the url of the verification code

	return ('zshare')
def get_link2(param,code):
	#should take the url that get_link1 returned
	#
	#returnes the video url
	return ()
	